package com.snail.starter.commons.error;

import lombok.Getter;
import lombok.ToString;

@Getter
@ToString
public enum CommonErrorCode implements IErrorCode {

    SUCCESS(200, "Success"),
    ERROR(500, "Error"),
    BIZ_ERROR(501, "Biz Error"),
    SYSTEM_ERROR(502, "System Error"),
    PARAM_ERROR(400, "Param Error"),
    NOT_LOGIN_IN(401, "Not logged in"),
    DATA_PARSE_ERROR(402, "Param Parse Error"),
    HAVE_ON_AUTHORITY(403, "Have On Authority"),
    HTTP_METHOD_NOT_SUPPORT(405, "Http Method : %s Not Support"),
    ILLEGAL_TOKEN(406, "illegal Token"),
    EXCEED_MAX_SESSION(407, "exceed max session"),
    OVER_FILE_SIZE(413, "upload over file size"),
    TOKEN_NOT_EXIST(409, "token not exist"),
    ILLEGAL_REQUEST(503, "Illegal request"),
    APP_NOT_EXISTS(10001001, "app not exits"),
    APP_DISABLE(10001002, "app disable"),
    APP_SECURE_ERROR(10001003, "app secure error"),
    APP_CALL_BACK_ERROR(10001004, "app call back error"),
    HTTP_RESPONSE_ERROR(10002001, "http response error"),
    HTTP_RESPONSE_STATUS_CODE_ERROR(10002002, "http response status code error"),
    ACCOUNT_NOT_EXISTS(10003001, "account not exists"),
    ACCOUNT_DISABLE(10003002, "account disable"),
    USER_NOT_EXISTS(10004001, "user not exists"),
    USER_DISABLE(10004002, "user disable"),
    PASSWORD_ERROR(10005001, "password error"),
    MISS_PARAM_ERROR(10005002, "miss param:%s"),
    ;

    private final Integer code;

    private final String defaultMessage;

    CommonErrorCode(Integer code, String defaultMessage) {
        this.code = code;
        this.defaultMessage = defaultMessage;
    }

    @Override
    public String getBundleName() {
        return "commons";
    }
}